/**
 * 
 */
package com.evon.yardmanagement.transformer;
import com.evon.yardmanagement.model.KeyBin;
import com.evon.yardmanagement.model.Yard;
import com.evon.yardmanagement.ui.dto.KeyBinDTO;


/**
 * @author Sandeep
 *
 */
public class KeyBinTransformer {
	
	public static KeyBin transformKeyBin(KeyBinDTO keyBinDto){
		/*KeyBin keyBin = new KeyBin();
		Yard yard = new Yard();
		yard.setId(keyBinDto.getYardDTO().getId());
		keyBin.setYard(yard);
		//keyBin.setId(keyBinDto.getKeyBinId());
		keyBin.setName(keyBinDto.getKeyBinName());
		keyBin.setBinNumber(keyBinDto.getKeyBinNumber());
		keyBin.setIsActive(keyBinDto.getActive()?1:0);
		keyBin.setCapacity(keyBinDto.getCapacity());
		keyBin.setIsOccupied(keyBinDto.getKeyOccupied()?1:0);
		*/
		return new BaseTransformer<KeyBin, KeyBinDTO>(KeyBin.class, KeyBinDTO.class).transformToModel(keyBinDto);
	}
	
	public static KeyBinDTO transformKeyBinToDTO (KeyBin keyBin){
		return new BaseTransformer<KeyBin, KeyBinDTO>(KeyBin.class, KeyBinDTO.class).transformToDTO(keyBin);
//		KeyBinDTO keyBinDTO = new KeyBinDTO();
//		keyBinDTO.setKeyBinNumber(keyBin.getBinNumber());
//		keyBinDTO.setKeyBinId(keyBin.getId());
//		keyBinDTO.setKeyBinName(keyBin.getName());
//		keyBinDTO.setKeyOccupied(keyBin.getIsOccupied()==1?true:false);
//		keyBinDTO.setActive(keyBin.getIsActive()==1?true:false);
//		keyBinDTO.setCapacity(keyBin.getCapacity());
//		return keyBinDTO;
	}

}
